package common.domain;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author LinLe
 * @create 2020-12-24 8:07
 */
//对于学员信息的封装
public class Student implements Serializable{
    private static final long serialVersionUID = 5868956622125675072L;
    //姓名
    private String name;
    //密码
    private String password;
    //成绩
    private int score;
    //是否参加考试过
    private boolean isTested;
    
    public boolean getIsTested() {
        return isTested;
    }
    
    public void setIsTested(boolean tested) {
        isTested = tested;
    }
    
    public int getScore() {
        return score;
    }
    
    public void setScore(int score) {
        this.score = score;
    }
    
    public Student() {
    }
    
    public Student(String name, String password) {
        this.name = name;
        this.password = password;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return name.equals(student.name);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(name);
    }
    
    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
